import Vue from 'vue'
import App from './App'
import router from './router'
import Element from 'element-ui'
import "element-ui/lib/theme-chalk/index.css"
import axios from "axios";
import store from './store'
import VueParticles from 'vue-particles' // vue粒子插件
import "./utils/request" // 自定义axios.js
import './assets/font/iconfont.css' // 导入iconfront
import hljs from 'highlight.js' // 代码高亮
import 'github-markdown-css/github-markdown.css'
import moment from "moment"; // 计算时间差
import MavonEditor from 'mavon-editor'  //引入mavon-editor
import 'mavon-editor/dist/css/index.css'

// 如果开启了typescript 需要额外安装 npm install @types/highlight.js
// 通过 import * as hljs from 'highlight.js' 引入
Vue.directive('highlight', function (el) {
  const blocks = el.querySelectorAll('pre code')
  blocks.forEach(block => {
    hljs.highlightBlock(block)
  })
})

Vue.use(Element)
Vue.use(MavonEditor)
Vue.use(VueParticles)
Vue.prototype.$axios = axios
Vue.prototype.$moment = moment
moment.locale("zh-cn")


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
